﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Entities.Portals;
    using Microsoft.VisualBasic;
    using System;
    using System.Web;

    public abstract class TokenExtraInterface
    {
        private static TokenExtraInterface objProvider = null;

        static TokenExtraInterface()
        {
            CreateProvider();
        }

        protected TokenExtraInterface()
        {
        }

        private static void CreateProvider()
        {
            string storeSetting = SharedFunctions.GetStoreSetting(((PortalSettings) HttpContext.Current.Items["PortalSettings"]).PortalId, "tokenextra.provider");
            if (storeSetting != "")
            {
                string[] strArray = Strings.Split(storeSetting, ",", -1, CompareMethod.Binary);
                objProvider = (TokenExtraInterface) Activator.CreateInstance(strArray[0], strArray[1]).Unwrap();
            }
        }

        public virtual string DoExtraReplace(int PortalID, string SourceText, string Lang, int OrderID)
        {
            return "";
        }

        public static TokenExtraInterface Instance()
        {
            return objProvider;
        }
    }
}

